home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Misc Utils / ObiWan / ObiWan Documentation < prev    next >
Text File  |  1993-08-04  |  17KB  |  247 lines

  1. ObiWan v4.0.1 and Master Yoda v4.0.1 © Peter Lewis, 1992-93.
  2.  
  3. These programs are Freeware.
  4.  
  5. ObiWan is dedicated to beta testers and freeware and shareware authors.
  6.  
  7. • Contents
  8.  
  9.       What ObiWan Does
  10.       Features
  11.       Using ObiWan
  12.       Using Master Yoda
  13.       Database Format
  14.       How It Works
  15.       Limitations
  16.       Small Print
  17.       Warranty
  18.       Fine Print
  19.       Version History
  20.       Acknowledgements
  21.       The Author
  22.  
  23. • What ObiWan Does
  24.  
  25. ObiWan is a general help system.  You can create several databses and ObiWan will let you rapidly find information from them.  It displays the information by temporarily taking over several lines at the bottom of the main screen, so the information can be displayed at any time in any program.  Portions of the information can then be sent to the front window as if you had typed it.  The main use of all this is to access the programming database created from Apple’s PInterfacesHelp file, which includes the procedures, traps, global variables and errors available up to System 7.
  26.  
  27. • Features
  28.  
  29. The Force file includes all the System 7 information.
  30. The Force database is created from the PInterfacesHelp file for easy updating.
  31. Any number of databases may exist, only one of which is active at any time.
  32. The hot keys may be changed at will via the control panel.
  33. First word searches are instantaneous, general searches are very quick.
  34. Databases are plain text files and can be edited at any time they are not active.
  35. Databases are reindexed automatically when the file size changes.
  36. Database file size is unlimited.
  37. Databases can have any number of entries.
  38. There is absolutely no dependency on MacTCP at all.
  39.  
  40. Caveats:
  41. Clicks occasionally go thru to the area of the screen that ObiWan has taken over, causing an unwanted application switch.   Whether I can fix this is an open question.  Anyone from Apple care to comment why sometimes jGNEFilter isn’t called?
  42.  
  43. The Finder seems to notice the loss of screen real estate, and moves the icons from underneath the area.  It only does this if the icon is within four pixels (I believe) of the edge, so placing the icons a little further away will normally fix this problem.
  44.  
  45. Keys typed in to ObiWan also go into a DA window if a DA is front-most.
  46.  
  47. • Using Master Yoda
  48.  
  49. Launch Master Yoda.  
  50.  
  51. If you prefer C over Pascal, click Set Insert Proc and select the C Parse Procedure from the Parse Procedures folder.  This affects the way command-shift-enter behaves when it insets a procedure into a document.
  52.  
  53. To parse the PInterfacesHelp file, click the “Parse PInterfacesHelp” button and select the PInterfacesHelp file (don’t select the CInterfacesHelp file, it won’t work), then select a destination for the Force file (the ObiWan Folder is a good place for it), and Master Yoda will create the file (about 720k, but you’ll need about 2Meg of free space to hold some temporary files).  This process will take some time, it takes around 3 minutes on a Quadra 700 from RAM disk, or around 10 minutes on a IIsi from HD, or around 45 minutes on a Plus.  Move the Force file to the “ObiWan Folder”, and move the “ObiWan Folder” to the Preferences Folder in the System Folder.  Then you are all set.
  54.  
  55. Master Yoda also lets you do other database operations - Select a database, and then click buttons to sort, merge another (sorted) database, get stats on it, etc.
  56.  
  57. • Using ObiWan
  58.  
  59. Drop ObiWan into the Control Panels folder (in System 7), or the System Folder (in System 6). Open the control panel and play around with the controls.  Move the ObiWan Folder into the Preferences folder (create the Preferences folder if necessary under System 6).  The ObiWan Folder contains all of the database files.  Restart your Mac.  If all goes well, the ObiWan icon will be displayed during the startup sequence.  
  60.  
  61. Here is an example session:
  62.  
  63. Press command-` (the command key is the cloverleaf key).  A small display should open at the bottom of the screen.  Type in “a<return>” and a short help will be displayed.  Press cmd-. to move forward thru the file, and cmd-, to move backwards.  Close and reopen the display by hitting cmd-` twice, and then type in “help<return>”.  Double click on ADSP and you will be taken to the secion listing for ADSP.  Double click “attnBufSize”.  Click at the end of this paragraph, and then press command-shift-enter (enter, not return).  Option-click in ObiWan’s display area to return to the ADSP section.  Close and reopen ObiWan and type “hparamblockshift-return>”.  Press cmd-. to find the next occurence.
  64.  
  65. The Force database is produced by parsing the PInterfacesHelp file which I have license from Apple.  Thanks to Rick Fleischman, Barbara Napier, and Apple Computer, Inc. for waiving the fee to allow the Force file to be distributed.  The Force file contains all the System 6 and 7 procedures, constants, errors, and global variables.  You can find these by opening ObiWan (cmd-`), typing in the start of the name (eg HOpen) and pressing return.  You can then insert the routine into THINK Pascal or C or MPW by pressing cmd-shift-enter.  Note that there is a Pascal bias in this database because I am biased towards Pascal, but there is no reason some bright spark couldn’t produce a C equivalent database.  You can also look up traps, errors, globals by searching for:
  66. trapA000 - four digit hex number, starting with A
  67. err-108 - decimal number, starting with a minus for OSErrs
  68. err25 - decimal number, positive for system errors.
  69. global910 - three digit hex number for global variables. (QuickDraw globals are not included)
  70.  
  71. The Force database is not special in any way (except that it contains the programming information for System 7).  You can create other databases and switch between them by typing <name><option-return>.  Other databases that are available will likely include: a dictionary, a thesaurus (both based on Roget's thesaurus from the Gutenburg project), and possibly a unix database (similar to Force, but for unix commands).
  72.  
  73. • Database Format
  74.  
  75. An ObiWan database is just a TEXT file with a strict format, plus some resources in the resource fork.  These include the index (which is recalculated if the file size changes); the word character set; and the parse procedure.  The format of the text file is (by example):
  76.  
  77. =|
  78. indexword data
  79. general stuff, up to 10 lines, each up to 80 characters, ending with a|
  80. nextindexword more data
  81. more stuff|
  82. verynextindexedword more and more data
  83. finally ending with|
  84. =|
  85.  
  86. The file should be sorted by the indexword (Master Yoda’s sort sorts by the entire entry so if you want related parts to stay in the same order when the database is sorted, they must be ordered in that way).  The sort order is straight ASCII, case insensitive.  Yes, I can hear you screaming “No, no, use the language independent sort order that the system defines”, (and yes, I do think that comma should go outside the quote mark irrespective of what the English teachers would have you believe :-) but I wish to be able to distribute a database file that works on all machines without having to be resorted.
  87.  
  88. Let’s see if I can define a BNF for the database format:
  89.  
  90. database ::= "=|" <cr> multiple_entries <cr> "=|" <cr>
  91.  
  92. multiple_entries ::= entry "|" <cr>
  93. multiple_entries ::= entry "|" <cr> multiple_entries
  94.  
  95. entry ::= line
  96. entry ::= line <cr> entry
  97.  
  98. line ::= character
  99. line ::= character | line
  100.  
  101. character ::= chr(9) | chr(32)..chr(126) | chr(128)..chr(255)
  102.  
  103. lines MUST be at most 80 characters, and should fit onto a Classic screen in Chicago 12 (which means they should be around 60 characters long).
  104. entries MUST be at most 10 lines.
  105. There is no limit to the file size or number of entries (well, ok, the file size is limited by the file system, but thats not my fault, and the number of entries is obviously limited by the size of the file...)
  106.  
  107. Note:  The file absolutely must start and end with =|<cr>.  No trailing blank lines.
  108.  
  109. • How It Works
  110.  
  111. At startup time ObiWan grabs a bunch of resource from the ObiWan and ObiWan Preferences files, and locks them all away in the system heap.  Then it adds itself to the jGNEFilter list, shows its icon, and plays the startup sound.  If this process fails then the failed icon is displayed.
  112.  
  113. Later on, it watches keypresses and if a match for the popup key appears it opens the display at the bottom of the main screen by mucking about with the GreyRegion (a region comprising the combined area of all the screens, minus the little rounded corners on the outermost screen).  It then displays the icon and accepts key strokes.  When you hit return it takes the first four letters of the word (padding with zeros), and scans thru an index to find where in the database that word comes, then it positions itself in the database and scans the entries until it finds a matching one and displays that.  The “anywhere” search is done using Boyer-Moore search routine - this is one of the most elegant and simple routines I’ve ever seen, if you ever do any searching code, check this out, it is hardly any more complicated than a brute force search, but takes time *inversely* proportional to the length of the seach string!
  114.  
  115. Entering characters into the front application is done by simply returning key down events in response to null events.  In v4.0.1 I added support for key codes as well, though Word still gets confused, but thats to be expected.
  116.  
  117. • Limitations
  118.  
  119. ObiWan & Master Yoda require System 6 or later and probably require the 128k ROM (or later). 
  120.  
  121. There is a problem with clicks in ObiWan’s display area sometimes going through to a background application, thereby causing the foreground application to be switched out and a background application (commonly the Finder) to be switched in.  This happens because the click is sometimes stolen before it gets to the jGNEFilter.  I have no idea why this would happen, nor why it happens only sometimes. If anyone has any ideas, please let me know.  
  122.  
  123. There is also a problem that key presses go into DA windows instead of ObiWan.  I don’t really think this is a major problem, but perhaps others disagree.
  124.  
  125. • Small Print
  126.  
  127. This program is totally free.  That’s right, pay nothing now, pay nothing later (but don’t expect me to send you a steak knife or any jewellery :-).  If you like it and use it you can show your appreciation by:
  128.  
  129. Sending me some Email or a Poastcard.
  130. Donating Blood.
  131. Giving me a free trip to wherever you are, or anywhere else.
  132. Picking up some litter.
  133. Or anything else you feel like doing :-)
  134.  
  135. • Warranty
  136.  
  137. There is absolutely NO warranty, guarantee, hint, suggestion or anything else that would lead anyone to think that ObiWan or Master Yoda do anything stated in this documentation.  It usually does not destroy data (systems, hardware, etc), and has sometimes worked on my Mac IIsi with System 7.0.  It should work with system 6, but probably not with systems before then and probably not with the 64k ROM.  It might work with the other models, but I don't have them all, so I don't know.  It does not require MacTCP in any way shape or form but should work even if you have MacTCP installed :).  If it works on your system (or especially if it doesn’t!), send me a postcard or some Email and let me know!
  138.  
  139. • Fine Print
  140.  
  141. Peter Lewis hereby disclaims all warranties relating to this software, whether express or implied, including without limitation any implied warranties of merchantability or fitness for a particular purpose.  Peter Lewis will not be liable for any special, incidental, consequential, indirect or similar damages due to loss of data or any other reason, even if Peter Lewis or an agent of his has been advised of the possibility of such damages.  In no event shall Peter Lewis be liable for any damages, regardless of the form of the claim.  The person using the software bears all risk as to the quality and performance of the software.
  142.  
  143. APPLE COMPUTER, INC. ("APPLE") MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING MPW.  APPLE DOES NOT WARRANT, GUARANTEE OR MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF MPW IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY, CURRENTNESS OR OTHERWISE.  THE ENTIRE RISK AS TO THE RESULTS AND PERFORMANCE OF MPW IS ASSUMED BY YOU.  THE EXCLUSION OF IMPLIED WARRANTIES IS NOT PERMITTED BY SOME STATES.  THE ABOVE EXCLUSION MAY NOT APPLY TO YOU.
  144.  
  145. IN NO EVENT WILL APPLE, ITS DIRECTORS, OFFICERS, EMPLOYEES OR AGENTS BE LIABLE FOR CONSEQUENCTIAL, INCIDENTAL OR INDIRECT DAMAGES (INCLUDING DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERUPTION, LOSS OF BUSINESS INFORMATION, AND THE LIKE) ARISING OUT OF THE USE OR INABILITY TO USE MPW EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  146.  
  147. BECAUSE SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITIES FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU.  Apple's liabilities to you for actual damages for any cause whatsoever, and regardless of the form of the action (whether in contract, tort (including negligence), product liability or otherwise), will be limited to $50.
  148.  
  149. And that goes double for Peter Lewis.
  150.  
  151. • Version History
  152.  
  153. Still to do -
  154. Yoda:
  155. Finish up Master Yoda
  156. Handle out of disk space errors better
  157. Revamp Yoda’s UI
  158. Master Yoda progress bar needs status display "Parsing" "Sorting" etc.
  159. Temporary files should be placed in the Temporary Items folder 
  160. Crashes on LC/6.0.7 when you choose Select Parse Proc.
  161.  
  162. Mike Engber <engber@newton.apple.com>:
  163. App for viewing the database
  164. Font selection (esp a monospaced font)
  165. Way to specify two or more keywords for one entry
  166. Way to escape | characters
  167. Way to more than 10 lines per entry
  168. Better debugging in Master Yoda (display anomolies)
  169.  
  170. Other:
  171. Search all databases, basically pretend that there is only a single database as much as possible.
  172. Decent documentation (any volunteers?)
  173. Double click STR# for Prefs and Parse Proc files.
  174.  
  175. No way to paste in entire struct/record description
  176. Typing in the ObiWan window when a DA is up puts keys into both!
  177. Does not [always?] properly alert user if it can't find the database?
  178. Clicks sometimes go thru to the background app.
  179.  
  180. Add the appropriate string resource into the ObiWan Preferences and
  181. Pascal Template Procedure so that when you launch them they put up nice
  182. messages saying 'ObiWan Preferences file must be placed in the Obiwan
  183. Folder within your Preferences Folder' and so on.
  184. STR -16397 I think
  185.  
  186. 4.0.1
  187. ~Support key codes so it works with terminal apps - still doesn’t work with Word :-)
  188. ~Include the Force database
  189. ~Report errors a bit better
  190. ~Fix MasterYoda parse proc crash
  191.  
  192. 4.0.0d5
  193. ~Balloon Help everywhere - THANKS QUINN!
  194. ~Added C Parse Procedure
  195. ~Improved param block parsing
  196.  
  197. 4.0.0d4
  198. ~Sound play only once every N minutes...
  199. ~Select the destination of the output Force file
  200. ~Add param blocks to database.
  201. ~Sounds should play asynchronously.
  202.  
  203. 4.0.0d2
  204. ~Fix the cmd-enter bug where it chooses the first word instead of the selected word
  205. ~Click in the R2D2 icon to turn typing on.
  206. ~No way to set the Switch Database hotkey
  207.  
  208. • Acknowledgements
  209.  
  210. Thanks to Jager, Quinn, and Rhys for their ideas and suggestions for ObiWan in the initial design phase.  Thanks you J&Q for the initial parsing of the PInterfacesHelp file.  Thanks also to the UCC, Curtin, Todd (have fun at RA!), Steve, c.s.m.p, plaza, ftp.apple.com, Stephen, and anyone who uses ObiWan!  Special thanks go to those brave souls who risked life and Mac beta testing an unknown program.
  211.  
  212. • The Author
  213.  
  214. Programs written by me:
  215. DeHQX 2.0.1 - BinHex decoder (use StuffIt Expander instead).
  216. Finger 1.3.7 - Macintosh Finger client/daemon.
  217. Talk 1.1.1 - Macintosh Talk client/daemon.
  218. Chat 1.1.0 - Multiuser primitive irc-like daemon.
  219. FTPd 2.1.0 - Macintosh FTP server.
  220. ObiWan 4.0.0 - Online help system.
  221. MacBinary II+ 1.0.2 - MacBinary II+ encoder/decoder.
  222. FetchNews 1.0.0b - Fetch News for use with NewsWatcher’s demo mode.
  223. MacTCP Watcher 1.1.0 - Display MacTCP’s state information.
  224. Bolo Finder 1.0.2 - Display the results from Mike Ellis' Bolo Tracker.
  225. Bolo RandomMap 1.1.0 - Generate a random map for Bolo.
  226.  
  227. You can get the latest development versions from redback.cs.uwa.edu.au, but please use the major archives for released version if at all possible.  Redback is a long long way from most people, and using it wastes bandwidth on the Australian-US satelite link which is overly congested already.  So use the versions posted to the archives (like sumex-aim.stanford.edu or mac.archive.umich.edu), and only use the development versions if you have some specific problem - in which case tell me!)
  228.  
  229. Send postcards, comments, bug reports, wishes, and payments to:
  230.  
  231. Peter Lewis,
  232. 10 Earlston Way,
  233. Booragoon, Perth, WA, 6154,
  234. AUSTRALIA
  235.  
  236. or by electronic mail to:
  237.  
  238. Internet: peter.lewis@info.curtin.edu.au
  239. Bitnet: peter.lewis%info.curtin.edu.au@cunyvm.bitnet
  240. UUCP: uunet!munnari.oz!info.curtin.edu.au!peter.lewis
  241.  
  242. Alternative addresses (in order from best to worst)
  243. peter@cujo.curtin.edu.au
  244. peter@ncrpda.curtin.edu.au
  245. peter@rocky.curtin.edu.au
  246. peter@ucc.gu.uwa.edu.au
  247.